Skip to content

[CL-1191] - spotlight and popover fixes#20519

Open
jaasen-livefront wants to merge 5 commits intomainfrom
CL-1186
Open

[CL-1191] - spotlight and popover fixes#20519
jaasen-livefront wants to merge 5 commits intomainfrom
CL-1186

Conversation

@jaasen-livefront
Copy link
Copy Markdown
Collaborator

@jaasen-livefront jaasen-livefront commented May 6, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/CL-1191

📔 Objective

Fixes issues with the spotlight effect used in guided tour popovers, and adds customization inputs to bit-popover.

Resize lag — CDK's reposition scroll strategy only reacts to scroll events, so resizing the window caused the spotlight cutout to trail behind the highlighted element. Added a window resize listener in SpotlightService that immediately calls updatePosition(), cleaned up when the overlay is disposed.

Spotlight cropping — The spotlight cutout was sizing to the directive's host element, which could be wider than the visual target (e.g. a full-width nav row). Added a spotlightTargetSelector input to PopoverAnchorForDirective that accepts a CSS selector to find a child element to use as the spotlight target instead.

📸 Screenshots

Screenshot 2026-05-05 at 2 17 16 PM
Screen.Recording.2026-05-05.at.2.18.15.PM.mov

@jaasen-livefront jaasen-livefront requested a review from a team as a code owner May 6, 2026 00:08
/** Optional title displayed in the popover header */
readonly title = input("");

/** Optional CSS class(es) applied to the inner content container */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaasen-livefront Why do we need to customize popover elements like this? Not sure we want to intentionally allow for inconsistent popover designs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are coming from the width/padding design feedback, we don't need to implement overrides here. Width and padding will be updated in #20021.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread libs/components/src/popover/spotlight.service.ts
Comment thread libs/components/src/tw-theme.css Outdated
--color-bg-hover: rgba(var(--color-gray-950-rgb), 0.05);
--color-bg-hover-contrast: rgba(var(--color-white-rgb), 0.05);
--color-bg-overlay: rgba(var(--color-gray-950-rgb), 0.3);
--color-bg-overlay: rgba(var(--color-gray-950-rgb), 0.55);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need this change. Does the sidenav item need to be showing it's hover state when we 'spotlight' it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the color defined by design for the backdrop globally. If we are going to make changes here we'll need sign-off from design to do so.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BryanCunningham Reverted.

@jaasen-livefront
Copy link
Copy Markdown
Collaborator Author

@BryanCunningham Updated the PR to focus only on two items that aren't covered by existing UIF work.

@jaasen-livefront jaasen-livefront requested a review from vleague2 May 6, 2026 22:38
@jaasen-livefront jaasen-livefront changed the title [CL-1186] - spotlight and popover fixes [CL-1192] - spotlight and popover fixes May 6, 2026
@jaasen-livefront jaasen-livefront changed the title [CL-1192] - spotlight and popover fixes [CL-1191] - spotlight and popover fixes May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.33%. Comparing base (a0933b8) to head (4681307).
⚠️ Report is 26 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/components/src/popover/spotlight.service.ts 0.00% 7 Missing ⚠️
...onents/src/popover/popover-anchor-for.directive.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20519      +/-   ##
==========================================
+ Coverage   47.11%   47.33%   +0.22%     
==========================================
  Files        3951     3956       +5     
  Lines      119744   120401     +657     
  Branches    18346    18525     +179     
==========================================
+ Hits        56417    56993     +576     
+ Misses      59092    59081      -11     
- Partials     4235     4327      +92     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* CSS selector to find a child element within the anchor to use as the spotlight target.
* If not provided, the anchor element itself is used.
*/
readonly spotlightTargetSelector = input<string>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this now. This will be handled in the service moving forward

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Removed. 4681307

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants